package com.lanou.mynews.video;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

import com.lanou.mynews.R;

public class VideoPlayerActivity extends AppCompatActivity {
    Intent intent;
    VideoView videoView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_player);
        videoView = (VideoView) findViewById(R.id.videoView);
        intent = getIntent();
    }

    @Override
    protected void onStart() {
        super.onStart();
        videoView.setVideoURI(Uri.parse(intent.getStringExtra("url")));
        videoView.setMediaController(new MediaController(this));
        videoView.requestFocus();
        videoView.setBackgroundColor(0x000000);
    }
}
